package com.itheima.controller;

import com.itheima.pojo.Chat;
import com.itheima.pojo.Result;
import com.itheima.service.ChatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/chat")
@RestController
public class ChatController {
    @Autowired
    private ChatService chatService;
    @RequestMapping("/send")
    public Result send(@RequestBody Chat chat){
        chatService.send(chat);
        return Result.success();
    }
    @RequestMapping("/getChatRecord")
    public Result getChatList(@RequestBody Chat chat){
        return Result.success(chatService.getChatList(chat));
    }
}
